package edu.westga.movierec.XAMPPtests.reader;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import edu.westga.movierec.model.*;
/**
 * Test methods for {@link edu.westga.movierec.model.XamppDBConnector#Recommender()}.
 * Tests recommender version 1 (with no modifiers to the database)
 * These tests may cease to work when history added.
 * 
 * @author Jean Cook, CS 6242, Fall 2009
 *
 */
public class RecommenderTests {
	private XamppDBConnector theDatabase;
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		this.theDatabase = new XamppDBConnector();
	}

	@Test
	public void shouldReturnScreamWhenUserIs1MovieIsSaw(){
		assertEquals(this.theDatabase.recommend(1, "Saw"),"Scream");
	}
	@Test
	public void shouldReturnAllRecommendedWhenUserIs1MovieIsScream(){
		assertEquals(this.theDatabase.recommend(1, "Scream"),"All movies are recommended.");
	}
	@Test
	public void shouldReturnGhostbustersWhenUserIs2MovieIsTitanic(){
		assertEquals(this.theDatabase.recommend(2,"Titanic"), "Ghostbusters");
	}
	@Test
	public void shouldReturnSerenityWhenUserIs5MovieIsTitanic(){
		assertEquals(this.theDatabase.recommend(5,"Ghostbusters"),"Scream");
	}
}
